package tr.edu.yildiz.ce.dap.appagent.service.infra;

import java.nio.channels.SelectionKey;

import tr.edu.yildiz.ce.dap.appagent.exception.AgentCommunicationException;

public interface NetworkManager {
	
	interface MessageReceivedCallBack{
		void onMessageReceived(String incomingMessage,SelectionKey sKey);
		void onConnectionFailed();
		void stop();
		boolean isStop();
	}

	String joinMulticast(String multicastAddress,int port) throws AgentCommunicationException;
	
	String sendMessage(String message,String address,int port) throws AgentCommunicationException;
	
	void listen(MessageReceivedCallBack mrCallBack,int port);
	
}
